<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title></title>
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
    />
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all" />
  </head>

  <body>
    <div class="layui-fluid">
      <div class="layui-card">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
          <ul class="layui-tab-title">
            {if $type<=3 || $type==11}
            <li class="{$type==1?'layui-this':''}">
              <a href="{:url('setting/indexpb',array('type'=>1, 'source_key'=>$source_key))}">站点配置</a>
            </li>
            <li class="{$type==2?'layui-this':''}">
              <a href="{:url('setting/indexpb',array('type'=>2, 'source_key'=>$source_key))}"
                >APP版本配置</a
              >
            </li>
            <li class="{$type==3?'layui-this':''}">
              <a href="{:url('setting/indexpb',array('type'=>3, 'source_key'=>$source_key))}">分享配置</a>
            </li>
            <!-- <li class="{$type==11?'layui-this':''}"><a
                                href="{:url('setting/indexpb',array('type'=>11, 'source_key'=>$source_key))}">登录弹窗配置</a></li> -->
            {if $source_key == 'pub'}
            <li class="">
              <a href="{:url('apppatch/index')}">安卓版本补丁配置</a>
            </li>
            <li class=""><a href="{:url('maintain/index')}">站点维护</a></li>
            {/if}
            {else/}
            <li class="{$type==1?'layui-this':''}">
              <a href="{:url('setting/indexlive',array('type'=>1))}"
                >腾讯云服务</a
              >
            </li>
            <li class="{$type==2?'layui-this':''}">
              <a href="{:url('setting/indexlive',array('type'=>2))}"
                >直播SDK配置</a
              >
            </li>
            <li class="{$type==3?'layui-this':''}">
              <a href="{:url('setting/indexlive',array('type'=>3))}"
                >热度公式配置</a
              >
            </li>
            <li class="{$type==4?'layui-this':''}">
              <a href="{:url('setting/indexpb',array('type'=>4, 'source_key'=>'pub'))}"
                >聊天室配置</a
              >
            </li>
            <li><a href="{:url('setting/tag')}">标签配置</a></li>
            {/if}
          </ul>
          <div class="layui-tab-content">
            <div class="layui-tab-item {$type==1 ?'layui-show':''}">
              <div class="layui-form" wid200="">
                <input
                  type="hidden"
                  name="type_flag"
                  value="{$type}"
                  placeholder=""
                />
                <input
                  class="input-source-key"
                  type="hidden"
                  name="source_key"
                  value="{$source_key}"
                  placeholder=""
                />
                <div class="layui-form-item">
                  <label class="layui-form-label">站点名称</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="site_name"
                      value="{$config_pub.site_name}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">站点域名</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="site_domain"
                      value="{$config_pub.site_domain}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">H5站点域名</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="h5_domain"
                      value="{$config_pub.h5_domain}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">图片上传域名</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="img_upload_url"
                      value="{$config_pub.img_upload_url}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">外部上传服务器</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="third_upload"
                      value="{$config_pub.third_upload}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">版权信息</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="copyright"
                      value="{$config_pub.copyright}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">图形验证开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="enable_captcha"
                    title="开启" {eq name="$config_pub.enable_captcha" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="enable_captcha" title="关闭" {eq
                    name="$config_pub.enable_captcha" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item" pane="">
                  <label class="layui-form-label">竞猜权限</label>
                  <div class="layui-input-block">
                    <input type="checkbox" name="quiz_factor[]"
                    lay-skin="primary" value="1" title="PC"
                    <?php if ($config_pub['quiz_factor'] & 1) {echo 'checked=""' ;} ?>>
                    <input type="checkbox" name="quiz_factor[]"
                    lay-skin="primary" value="2" title="IOS"
                    <?php if ($config_pub['quiz_factor'] & 2) {echo 'checked=""' ;} ?>>
                    <input type="checkbox" name="quiz_factor[]"
                    lay-skin="primary" value="4" title="安卓"
                    <?php if ($config_pub['quiz_factor'] & 4) {echo 'checked=""' ;} ?>>
                  </div>
                </div>
                <!-- <div class="layui-form-item" pane="">
                                <label class="layui-form-label">登录弹窗</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" name="dialog_switch[]" lay-skin="primary" value="1"
                                        title="PC" <?php if ($config_pub['dialog_switch'] & 1) {echo 'checked=""' ;} ?>>
                                    <input type="checkbox" name="dialog_switch[]" lay-skin="primary" value="2"
                                        title="H5" <?php if ($config_pub['dialog_switch'] & 2) {echo 'checked=""' ;} ?>>
                                    <input type="checkbox" name="dialog_switch[]" lay-skin="primary" value="4"
                                        title="IOS" <?php if ($config_pub['dialog_switch'] & 4) {echo 'checked=""' ;}
                                        ?>>
                                    <input type="checkbox" name="dialog_switch[]" lay-skin="primary" value="8"
                                        title="安卓" <?php if ($config_pub['dialog_switch'] & 8) {echo 'checked=""' ;} ?>>
                                </div>
                            </div> -->
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">弹窗开关</label>
                            <div class="layui-input-block">
                                <input type="radio" value="1" name="popup_toggle" title="开启" {eq name="$config_pub.popup_toggle" value="1" }checked{/eq} />
                                <input type="radio" value="0" name="popup_toggle" title="关闭" {eq name="$config_pub.popup_toggle" value="0" }checked{/eq} />
                            </div>
                        </div> -->
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">好友邀请活动开关</label>
                            <div class="layui-input-block">
                                <input type="radio" value="1" name="invit_activity_toggle" title="开启" {eq name="$config_pub.invit_activity_toggle" value="1" }checked{/eq} />
                                <input type="radio" value="0" name="invit_activity_toggle" title="关闭" {eq name="$config_pub.invit_activity_toggle" value="0" }checked{/eq} />
                            </div>
                        </div> -->
                {if $source_key != 'pub'}
                <div class="layui-form-item">
                  <label class="layui-form-label">绿包变正常包</label>
                  <div class="layui-input-inline">
                      <input type="text" name="sem_to_normal_timer"
                          value="{$config_pub.sem_to_normal_timer}" class="layui-input"
                          placeholder="开启开数" />
                  </div>
                  <div class="layui-input-inline" style="height:35px;line-height: 40px;color:red">
                      [多少分钟后自动开启]
                  </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">绿包变正常包渠道号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="sem_to_normal" value="{$config_pub.sem_to_normal}"
                            class="layui-input" placeholder="正常包渠道号" />
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">绿包变正常包渠道号2</label>
                    <div class="layui-input-inline">
                        <input type="text" name="sem_to_normal2" value="{$config_pub.sem_to_normal2}"
                            class="layui-input" placeholder="正常包渠道号" />
                    </div>
                </div>
                {/if}
                <div class="layui-form-item">
                  <label class="layui-form-label">弹出联系方式</label>
                  <div class="layui-input-inline">
                    <input
                      type="text"
                      name="pop_contact"
                      value="{$config_pub.pop_contact}"
                      class="layui-input"
                      placeholder="弹出联系方式"
                    />
                  </div>
                  <div
                    class="layui-input-inline"
                    style="height: 35px; line-height: 40px; color: red"
                  >
                    [多少天后自动开启]
                  </div>
                  <!-- <input type="radio" value="1" name="pop_contact" title="开启" {eq
                                        name="$config_pub.pop_contact" value="1" }checked{/eq} />
                                    <input type="radio" value="0" name="pop_contact" title="关闭" {eq
                                        name="$config_pub.pop_contact" value="0" }checked{/eq} /> -->
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">直播聊天室</label>
                  <div class="layui-input-inline">
                    <input
                      type="text"
                      name="chatroom_toggle"
                      value="{$config_pub.chatroom_toggle}"
                      class="layui-input"
                      placeholder="直播聊天室"
                    />
                  </div>
                  <div
                    class="layui-input-inline"
                    style="height: 35px; line-height: 40px; color: red"
                  >
                    [多少天后自动开启]
                  </div>
                  <!-- <div class="layui-input-block">
                                    <input type="radio" value="1" name="chatroom_toggle" title="开启" {eq
                                        name="$config_pub.chatroom_toggle" value="1" }checked{/eq} />
                                    <input type="radio" value="0" name="chatroom_toggle" title="关闭" {eq
                                        name="$config_pub.chatroom_toggle" value="0" }checked{/eq} />
                                </div> -->
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">私聊开关</label>
                  <div class="layui-input-inline">
                    <input
                      type="text"
                      name="private_message_toggle"
                      value="{$config_pub.private_message_toggle}"
                      class="layui-input"
                      placeholder="私聊开关"
                    />
                  </div>
                  <div
                    class="layui-input-inline"
                    style="height: 35px; line-height: 40px; color: red"
                  >
                    [多少分钟后自动开启]
                  </div>
                  <!-- <div class="layui-input-block">
                                    <input type="radio" value="1" name="private_message_toggle" title="开启" {eq
                                        name="$config_pub.private_message_toggle" value="1" }checked{/eq} />
                                    <input type="radio" value="0" name="private_message_toggle" title="关闭" {eq
                                        name="$config_pub.private_message_toggle" value="0" }checked{/eq} />
                                </div> -->
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">观看时长判断开关</label>
                  <div class="layui-input-inline">
                      <input type="text" name="watch_dur_toggle"
                          value="{$config_pub.watch_dur_toggle}" class="layui-input"
                          placeholder="观看时长判断开关" />
                  </div>
                  <div class="layui-input-inline" style="height:35px;line-height: 40px;color:red">
                      [多少分钟后启用全部功能]
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">直播开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="live_toggle"
                    title="开启" {eq name="$config_pub.live_toggle" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="live_toggle" title="关闭" {eq
                    name="$config_pub.live_toggle" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">我的用户中心开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="user_center"
                    title="开启" {eq name="$config_pub.user_center" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="user_center" title="关闭" {eq
                    name="$config_pub.user_center" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">老虎机游戏开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="slot_machine_game"
                    title="开启" {eq name="$config_pub.slot_machine_game"
                    value="1" }checked{/eq} /> <input type="radio" value="0"
                    name="slot_machine_game" title="关闭" {eq
                    name="$config_pub.slot_machine_game" value="0" }checked{/eq}
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">安卓有料开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="expert_android_toggle"
                    title="开启" {eq name="$config_pub.expert_android_toggle"
                    value="1" }checked{/eq} /> <input type="radio" value="0"
                    name="expert_android_toggle" title="关闭" {eq
                    name="$config_pub.expert_android_toggle" value="0"
                    }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS有料开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="expert_ios_toggle"
                    title="开启" {eq name="$config_pub.expert_ios_toggle"
                    value="1" }checked{/eq} /> <input type="radio" value="0"
                    name="expert_ios_toggle" title="关闭" {eq
                    name="$config_pub.expert_ios_toggle" value="0" }checked{/eq}
                    />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">强制登陆模式</label>
                  <div class="layui-input-inline">
                    <input type="radio" value="1" name="power_mode" title="开启"
                    {eq name="$config_pub.power_mode" value="1" }checked{/eq} />
                    <input type="radio" value="0" name="power_mode" title="关闭"
                    {eq name="$config_pub.power_mode" value="0" }checked{/eq} />
                  </div>
                  <div
                    class="layui-input-inline"
                    style="height: 35px; line-height: 40px"
                  >
                    (验证码：9999)
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">世界杯专题开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1"
                    name="worldcup_thematic_toggle" title="开启" {eq
                    name="$config_pub.worldcup_thematic_toggle" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="worldcup_thematic_toggle" title="关闭" {eq
                    name="$config_pub.worldcup_thematic_toggle" value="0"
                    }checked{/eq} />
                  </div>
                </div>
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">世界杯竞猜开关</label>
                            <div class="layui-input-block">
                                <input type="radio" value="1" name="worldcup_guess_toggle" title="开启" {eq name="$config_pub.worldcup_guess_toggle" value="1" }checked{/eq} />
                                <input type="radio" value="0" name="worldcup_guess_toggle" title="关闭" {eq name="$config_pub.worldcup_guess_toggle" value="0" }checked{/eq} />
                            </div>
                        </div> -->
                <div class="layui-form-item">
                  <label class="layui-form-label">转盘抽奖开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="lottery_switch"
                    title="开启" {eq name="$config_pub.lottery_switch" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="lottery_switch" title="关闭" {eq
                    name="$config_pub.lottery_switch" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">达人榜</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="talent_list_status"
                    title="开启" {eq name="$config_pub.talent_list_status"
                    value="1" }checked{/eq} /> <input type="radio" value="0"
                    name="talent_list_status" title="关闭" {eq
                    name="$config_pub.talent_list_status" value="0"
                    }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">签到开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="checkin_switch"
                    title="开启" {eq name="$config_pub.checkin_switch" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="checkin_switch" title="关闭" {eq
                    name="$config_pub.checkin_switch" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">赛事开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="match_toggle"
                    title="开启" {eq name="$config_pub.match_toggle" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="match_toggle" title="关闭" {eq
                    name="$config_pub.match_toggle" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">资讯开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="news_toggle"
                    title="开启" {eq name="$config_pub.news_toggle" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="news_toggle" title="关闭" {eq
                    name="$config_pub.news_toggle" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">未登录聊天开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="anonymous_chat_toggle"
                    title="开启" {eq name="$config_pub.anonymous_chat_toggle" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="anonymous_chat_toggle" title="关闭" {eq
                    name="$config_pub.anonymous_chat_toggle" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">充值开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="recharge_toggle"
                    title="开启" {eq name="$config_pub.recharge_toggle" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="recharge_toggle" title="关闭" {eq
                    name="$config_pub.recharge_toggle" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">观赛券开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="ticket_switch"
                    title="开启" {eq name="$config_pub.ticket_switch" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="ticket_switch" title="关闭" {eq
                    name="$config_pub.ticket_switch" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item" pane="">
                  <label class="layui-form-label">视频开关</label>
                  <div class="layui-input-block">
                    <input type="checkbox" name="video_switch[]"
                    lay-skin="primary" value="1" title="PC"
                    <?php if ($config_pub['video_switch'] & 1) {echo 'checked=""' ;} ?>>
                    <input type="checkbox" name="video_switch[]"
                    lay-skin="primary" value="2" title="IOS"
                    <?php if ($config_pub['video_switch'] & 2) {echo 'checked=""' ;} ?>>
                    <input type="checkbox" name="video_switch[]"
                    lay-skin="primary" value="4" title="安卓"
                    <?php if ($config_pub['video_switch'] & 4) {echo 'checked=""' ;} ?>>
                  </div>
                </div>

                <div class="layui-form-item" pane="">
                  <label class="layui-form-label">直播预告开关</label>
                  <div class="layui-input-block">
                    <input type="checkbox" name="live_preview_switch[]"
                    lay-skin="primary" value="1" title="PC"
                    <?php if ($config_pub['live_preview_switch'] & 1) {echo 'checked=""'
                                        ;} ?>> <input type="checkbox"
                    name="live_preview_switch[]" lay-skin="primary" value="2"
                    title="H5"
                    <?php if ($config_pub['live_preview_switch'] & 2) {echo 'checked=""'
                                        ;} ?>> <input type="checkbox"
                    name="live_preview_switch[]" lay-skin="primary" value="4"
                    title="IOS"
                    <?php if ($config_pub['live_preview_switch'] & 4) {echo 'checked=""'
                                        ;} ?>> <input type="checkbox"
                    name="live_preview_switch[]" lay-skin="primary" value="8"
                    title="安卓"
                    <?php if ($config_pub['live_preview_switch'] & 8) {echo 'checked=""'
                                        ;} ?>>
                  </div>
                </div>

                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">视频上传秘钥</label>
                            <div class="layui-input-block">
                                <input type="text" name="video_upload_key" value="{$config_pub.video_upload_key}" class="layui-input" placeholder="视频上传秘钥"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">视频上传地址</label>
                            <div class="layui-input-block">
                                <input type="text" name="video_upload_url" value="{$config_pub.video_upload_url}" class="layui-input" placeholder="视频上传地址"/>
                            </div>
                        </div> -->
                <div class="layui-form-item">
                  <label class="layui-form-label">直播间水印</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="watermark_toggle"
                    title="开启" {eq name="$config_pub.watermark_toggle"
                    value="1" }checked{/eq} /> <input type="radio" value="0"
                    name="watermark_toggle" title="关闭" {eq
                    name="$config_pub.watermark_toggle" value="0" }checked{/eq}
                    />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">直播间水印文件</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="watermark_file"
                      value="{$config_pub.watermark_file}"
                      class="layui-input"
                      placeholder="视频播放地址"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">视频播放地址</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="video_play_url"
                      value="{$config_pub.video_play_url}"
                      class="layui-input"
                      placeholder="视频播放地址"
                    />
                  </div>
                </div>
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">皮肤类型</label>
                            <div class="layui-input-inline">
                                <select name="face_type" lay-verify="required">
                                    <option value="0" {$config_pub.face_type==0?'selected':''}>默认</option>
                                    <option value="1" {$config_pub.face_type==1?'selected':''}>卡塔尔</option>
                                </select>
                            </div>
                        </div> -->
                <div class="layui-form-item">
                  <label class="layui-form-label">网络经营许可证</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="license"
                      value="{$config_pub.license}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">微信公众号</label>
                            <div class="layui-input-block">
                                <input type="text" name="service_wx_official" value="{$config_pub.service_wx_official}" class="layui-input" placeholder="" lay-verify="required"/>
                            </div>
                        </div> -->
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">客服微信</label>
                            <div class="layui-input-block">
                                <input type="text" name="service_wx" value="{$config_pub.service_wx}" class="layui-input" placeholder="" lay-verify="required"/>
                            </div>
                        </div> -->
                <div class="layui-form-item">
                  <label class="layui-form-label">客服泡泡</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="service_paopao"
                      value="{$config_pub.service_paopao}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">问题反馈QQ</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="service_qq"
                      value="{$config_pub.service_qq}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">客服邮箱</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="service_email"
                      value="{$config_pub.service_email}"
                      class="layui-input"
                      placeholder=""
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">商务邮箱</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="business_email"
                      value="{$config_pub.business_email}"
                      class="layui-input"
                      placeholder=""
                    />
                  </div>
                </div>
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">主播申请QQ</label>
                            <div class="layui-input-block">
                                <input type="text" name="apply_anchor" value="{$config_pub.apply_anchor}" class="layui-input" placeholder="" lay-verify="required"/>
                            </div>
                        </div> -->
                <div class="layui-form-item">
                  <label class="layui-form-label">客服链接</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="service_url"
                      value="{$config_pub.service_url}"
                      class="layui-input"
                      placeholder=""
                      lay-verify=""
                    />
                  </div>
                </div>
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">客服开关</label>
                            <div class="layui-input-block">
                                <input type="radio" value="1" name="service_toggle" title="开启" {eq name="$config_pub.service_toggle" value="1" }checked{/eq} />
                                <input type="radio" value="0" name="service_toggle" title="关闭" {eq name="$config_pub.service_toggle" value="0" }checked{/eq} />
                            </div>
                        </div> -->

                <div class="layui-form-item">
                  <label class="layui-form-label">后台私聊socket地址</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="private_chat_ws"
                      value="{$config_pub.private_chat_ws}"
                      class="layui-input"
                      placeholder="ws://或wss://"
                      lay-verify="required"
                    />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">极验图片域名</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="captcha_path"
                      value="{$config_pub.captcha_path}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label" title="流畅,标清,超清,原画"
                    >解析度域名</label
                  >
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="stream_url"
                      value="{$config_pub.stream_url}"
                      class="layui-input"
                      placeholder="流畅,标清,超清,原画"
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">图片域名</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="img_domain"
                      value="{$config_pub.img_domain}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">默认用户头像URL</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="default_avatar_url"
                      value="{$config_pub.default_avatar_url}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">默认赛事LOGO_URL</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="default_match_logo_url"
                      value="{$config_pub.default_match_logo_url}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS极速版下载地址</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="dl_ios_hw"
                      value="{$config_pub.dl_ios_hw}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">短信推广跳转</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="sms_promotion"
                      value="{$config_pub.sms_promotion}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label">微信公众号二维码</label>
                            <div class="layui-input-inline" style="width: 400px;">
                                <input name="wx_pub" id="LAY_wx_pub_src" placeholder="图片地址" value="{$config_pub.wx_pub}" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-btn-container" style="width: auto;">
                                <button type="button" class="layui-btn layui-btn-primary" id="LAY_wx_pub_upload">
                                    <i class="layui-icon">&#xe67c;</i>上传图片
                                </button>
                                <button class="layui-btn layui-btn-primary" id="LAY_wx_pub_preview">查看图片</button>
                            </div>
                        </div> -->
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label ">微博二维码</label>
                            <div class="layui-input-inline" style="width: 400px;">
                                <input name="weibo" id="LAY_weibo_src" placeholder="图片地址" value="{$config_pub.weibo}" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-btn-container" style="width: auto;">
                                <button type="button" class="layui-btn layui-btn-primary" id="LAY_weibo_upload">
                                    <i class="layui-icon">&#xe67c;</i>上传图片
                                </button>
                                <button class="layui-btn layui-btn-primary" id="LAY_weibo_preview">查看图片</button>
                            </div>
                        </div> -->
                <!--                         <div class="layui-form-item">
                            <label class="layui-form-label ">抖音二维码</label>
                            <div class="layui-input-inline" style="width: 400px;">
                                <input name="douyin" id="LAY_douyin_src" placeholder="图片地址" value="{$config_pub.douyin}" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-btn-container" style="width: auto;">
                                <button type="button" class="layui-btn layui-btn-primary" id="LAY_douyin_upload">
                                    <i class="layui-icon">&#xe67c;</i>上传图片
                                </button>
                                <button class="layui-btn layui-btn-primary" id="LAY_douyin_preview">查看图片</button>
                            </div>
                        </div> -->
                <div class="layui-form-item">
                  <div class="layui-input-block">
                    <button
                      class="layui-btn"
                      lay-submit=""
                      lay-filter="configpub-save"
                    >
                      确认保存
                    </button>
                  </div>
                </div>
              </div>
            </div>
            <div class="layui-tab-item {$type==2 ?'layui-show':''}">
              <div class="layui-form" wid200="">
                <input
                  class="input-source-key"
                  type="hidden"
                  name="source_key"
                  value="{$source_key}"
                  placeholder=""
                />
                <div class="layui-form-item">
                  <label class="layui-form-label">App壳切换开关</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="app_face" title="开" {eq
                    name="$config_pub.app_face" value="1" }checked{/eq} />
                    <input type="radio" value="0" name="app_face" title="关" {eq
                    name="$config_pub.app_face" value="0" }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">安卓版本号</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="version_android"
                      value="{$config_pub.version_android}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">安卓下载地址</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="dl_android"
                      value="{$config_pub.dl_android}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">安卓下载地址PWA</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="dl_android_pwa"
                      value="{$config_pub.dl_android_pwa}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">安卓下载地址:uotxge.cn</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="dl_android_uotxge"
                      value="{$config_pub.dl_android_uotxge}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">安卓更新说明</label>
                  <div class="layui-input-block">
                    <textarea
                      name="update_info_android"
                      class="layui-textarea"
                      placeholder=""
                      lay-verify="required"
                    >
{$config_pub.update_info_android}</textarea
                    >
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">安卓整型版本代号</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="android_version_num"
                      value="{$config_pub.android_version_num|default=''}"
                      class="layui-input"
                      lay-verify="number"
                      placeholder="请输入整数"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">安卓最小可用版本</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="android_min_version"
                      value="{$config_pub.android_min_version|default=''}"
                      class="layui-input"
                      lay-verify="number"
                      placeholder="请输入整数"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">安卓商城包到官网更新</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="force_update_official"
                    title="开" {eq name="$config_pub.force_update_official"
                    value="1" }checked{/eq} /> <input type="radio" value="0"
                    name="force_update_official" title="关" {eq
                    name="$config_pub.force_update_official" value="0"
                    }checked{/eq} />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">IOS版本号(appstore)</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="version_ios"
                      value="{$config_pub.version_ios}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">IOS下载地址(appstore)</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="dl_web_url"
                      value="{$config_pub.dl_web_url}"
                      class="layui-input"
                      placeholder="http:// 或 https:// 开头"
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS更新说明(appstore)</label>
                  <div class="layui-input-block">
                    <textarea
                      name="update_info_ios"
                      class="layui-textarea"
                      placeholder=""
                      lay-verify="required"
                    >
{$config_pub.update_info_ios}</textarea
                    >
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS强更开关(appstore)</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1" name="appios_upgrade_toggle"
                    title="开" {eq name="$config_pub.appios_upgrade_toggle"
                    value="1" }checked{/eq} /> <input type="radio" value="0"
                    name="appios_upgrade_toggle" title="关" {eq
                    name="$config_pub.appios_upgrade_toggle" value="0"
                    }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS版本号(超级签)</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="version_ios_shop"
                      value="{$config_pub.version_ios_shop}"
                      class="layui-input"
                      placeholder=""
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS下载地址(超级签)</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="dl_ios_shop_url"
                      value="{$config_pub.dl_ios_shop_url}"
                      class="layui-input"
                      placeholder="http:// 或 https:// 开头"
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS更新说明(超级签)</label>
                  <div class="layui-input-block">
                    <textarea
                      name="update_info_ios_shop"
                      class="layui-textarea"
                      placeholder=""
                      lay-verify="required"
                    >
{$config_pub.update_info_ios_shop}</textarea
                    >
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS强更开关(超级签)</label>
                  <div class="layui-input-block">
                    <input type="radio" value="1"
                    name="appios_shop_upgrade_toggle" title="开" {eq
                    name="$config_pub.appios_shop_upgrade_toggle" value="1"
                    }checked{/eq} /> <input type="radio" value="0"
                    name="appios_shop_upgrade_toggle" title="关" {eq
                    name="$config_pub.appios_shop_upgrade_toggle" value="0"
                    }checked{/eq} />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">IOS下载地址(uotxge.cn)</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="dl_ios_uotxge"
                      value="{$config_pub.dl_ios_uotxge}"
                      class="layui-input"
                      placeholder="http:// 或 https:// 开头"
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label"
                    >IOS下载地址-极速版(uotxge.cn)</label
                  >
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="dl_ios_web_uotxge"
                      value="{$config_pub.dl_ios_web_uotxge}"
                      class="layui-input"
                      placeholder="http:// 或 https:// 开头"
                      lay-verify="required"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <div class="layui-input-block">
                    <button
                      class="layui-btn"
                      lay-submit=""
                      lay-filter="configpub-save"
                    >
                      确认保存
                    </button>
                  </div>
                </div>
              </div>
            </div>
            <div class="layui-tab-item {$type==3 ?'layui-show':''}">
              <div class="layui-form" wid200="">
                <input
                  class="input-source-key"
                  type="hidden"
                  name="source_key"
                  value="{$source_key}"
                  placeholder=""
                />
                <div class="layui-form-item">
                  <label class="layui-form-label">直播间分享链接</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="share_live_url"
                      value="{$config_pub.share_live_url}"
                      class="layui-input"
                      lay-verify="required"
                      placeholder="http:// 或 https:// 开头，/结尾"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">短视频分享链接</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="share_shortvideo_url"
                      value="{$config_pub.share_shortvideo_url}"
                      class="layui-input"
                      lay-verify="required"
                      placeholder="http:// 或 https:// 开头，/结尾"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">动态分享链接</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="share_moment_url"
                      value="{$config_pub.share_moment_url}"
                      class="layui-input"
                      lay-verify="required"
                      placeholder="http:// 或 https:// 开头，/结尾"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <div class="layui-input-block">
                    <button
                      class="layui-btn"
                      lay-submit=""
                      lay-filter="configpub-save"
                    >
                      确认保存
                    </button>
                  </div>
                </div>
              </div>
            </div>
            <!-- <div class="layui-tab-item {$type==11 ?'layui-show':''}">
                        <div class="layui-form" wid200="">
                            <div class="layui-form-item">
                                <label class="layui-form-label">弹窗标题</label>
                                <div class="layui-input-block">
                                    <input type="text" name="dialog_title" value="{$config_pub.dialog_title}"
                                        class="layui-input" lay-verify="required" />
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">观看时长</label>
                                <div class="layui-input-block">
                                    <input type="text" name="dialog_timeout" value="{$config_pub.dialog_timeout}"
                                        class="layui-input" lay-verify="required" placeholder="秒" />
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">强制注册模式</label>
                                <div class="layui-input-block">
                                    <input type="radio" value="1" name="dialog_force_reg" title="关闭" {eq
                                        name="$config_pub.dialog_force_reg" value="2" }checked{/eq} />
                                    <input type="radio" value="0" name="dialog_force_reg" title="开启" {eq
                                        name="$config_pub.dialog_force_reg" value="1" }checked{/eq} />
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">每日触发次数</label>
                                <div class="layui-input-block">
                                    <input type="text" name="dialog_daily_times"
                                        value="{$config_pub.dialog_daily_times}" class="layui-input"
                                        lay-verify="required" placeholder="" />
                                </div>
                            </div>
                            <div class="layui-form-item" id="img1">
                                <label class="layui-form-label">WEB端配置</label>
                                <div class="layui-input-inline" style="width: 400px">
                                    <input name="dialog_web_image" lay-verify="required" id="LAY_iconImgSrc"
                                        placeholder="图片地址" value="" class="layui-input" />
                                </div>
                                <div class="layui-input-inline layui-btn-container" style="width: auto">
                                    <button type="button" class="layui-btn layui-btn-primary" id="LAY_iconImgUpload">
                                        <i class="layui-icon">&#xe67c;</i>上传图片
                                    </button>
                                </div>
                            </div>
                            <div class="layui-form-item" id="img2">
                                <label class="layui-form-label">移动端横屏</label>
                                <div class="layui-input-inline" style="width: 400px">
                                    <input name="dialog_mobile_image_h" lay-verify="required" id="LAY_iconImgSrc1"
                                        placeholder="图片地址" value="" class="layui-input" />
                                </div>
                                <div class="layui-input-inline layui-btn-container" style="width: auto">
                                    <button type="button" class="layui-btn layui-btn-primary" id="LAY_iconImgUpload1">
                                        <i class="layui-icon">&#xe67c;</i>上传图片
                                    </button>
                                </div>
                            </div>
                            <div class="layui-form-item" id="img3">
                                <label class="layui-form-label">移动端竖屏</label>
                                <div class="layui-input-inline" style="width: 400px">
                                    <input name="dialog_mobile_image_v" lay-verify="required" id="LAY_iconImgSrc2"
                                        placeholder="图片地址" value="" class="layui-input" />
                                </div>
                                <div class="layui-input-inline layui-btn-container" style="width: auto">
                                    <button type="button" class="layui-btn layui-btn-primary" id="LAY_iconImgUpload2">
                                        <i class="layui-icon">&#xe67c;</i>上传图片
                                    </button>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="configpub-save">
                                        确认保存
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div> -->

            <div class="layui-tab-item {$type==4 ?'layui-show':''}">
              <div class="layui-form" wid200="">
                <div class="layui-form-item">
                  <label class="layui-form-label">聊天室认证url</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="chat_auth_url"
                      value="{$config_pub.chat_auth_url}"
                      class="layui-input"
                      placeholder=""
                      lay-verify=""
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label"
                    >聊天室地址(多个逗号分开)</label
                  >
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="chat_url"
                      value="{$config_pub.chat_url??''}"
                      class="layui-input"
                      lay-verify="required"
                      placeholder=""
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">聊天室系统提示</label>
                  <div class="layui-input-block">
                    <textarea
                      type="text"
                      maxlength="500"
                      lay-min="10"
                      placeholder="请输入系统提示，10-200个字符数限制"
                      name="chat_sys_message"
                      class="layui-textarea"
                      lay-verify="required|content"
                    >
{$config_pub.chat_sys_message??''}</textarea
                    >
                  </div>
                </div>

                <div class="layui-form-item">
                  <div class="layui-input-block">
                    <!--这个地方多加一个表单是区分写日志用-->
                    <input type="hidden" name="edit_type" value="live" />
                    <button
                      class="layui-btn"
                      lay-submit=""
                      name = "live_type_save"
                      lay-filter="configpub-save"
                    >
                      确认保存
                    </button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <script src="/assets/cos-js-sdk-v5/cos-js-sdk-v5.js"></script>
    <script src="/layuiadmin/layui/layui.js"></script>
    <script>
      layui
        .config({
          base: "/layuiadmin/",
          version: "{:config('other.ui_version')}",
        })
        .extend({
          index: "lib/index", //主入口模块
        })
        .use(["index", "setting"]);

        //渠道号会从source传递过来
        function getQueryParameter(param) {
            const urlParams = new URLSearchParams(window.location.search);
            return urlParams.get(param);
        }

        // 获取父页面传递的消息
        const source_key = getQueryParameter('source_key');

        layui.use(['form'], function () {
          var $ = layui.jquery, form = layui.form;

          // 接收来自父页面的消息
          window.addEventListener('message', function (event) {
              if (event.data.type === 'update-source') {
                  var source = event.data.source;            
                  // 更新所有source_key输入框
                  $('.input-source-key').val(source);
                  
                  // 按顺序提交三个表单
                  submitForms(source);
              }
          });

          // 分步提交表单的函数
          function submitForms(source) {
              // 显示加载遮罩
              var loadIndex = layer.load(1, {
                  shade: [0.5,'#000'] // 0.5透明度的黑色背景
              });
              
              var forms = [
                  {type: 1, selector: '.layui-tab-item:eq(0) .layui-form'},
                  {type: 2, selector: '.layui-tab-item:eq(1) .layui-form'},
                  {type: 3, selector: '.layui-tab-item:eq(2) .layui-form'}
              ];

              function submitNextForm(index) {
                  if (index >= forms.length) {
                      // 所有表单都已提交完成
                      setTimeout(function() {
                          layer.close(loadIndex); // 关闭遮罩
                          layer.msg('保存成功', {
                              icon: 1,
                              time: 1000
                          }, function() {
                              // 刷新父页面
                              if (window.parent && window.parent.location) {
                                  window.parent.location.reload();
                              }
                          });
                      }, 500);
                      return;
                  }

                  var currentForm = forms[index];
                  var $form = $(currentForm.selector);
                  
                  // 确保表单存在
                  if ($form.length === 0) {
                      submitNextForm(index + 1);
                      return;
                  }

                  // 更新表单数据
                  var formData = $form.serializeArray();
                  formData.push({name: 'source_key', value: source});
                  formData.push({name: 'type_flag', value: currentForm.type});

                  // 提交当前表单
                  form.on('submit(configpub-save)', function(data) {
                      data.field.source_key = source;
                      data.field.type_flag = currentForm.type;                 
                      // 使用layui的ajax提交
                      $.ajax({
                          url: '/admin/setting/savepub',
                          type: 'POST',
                          data: data.field,
                          success: function(res) {
                              if (res.code === 0) { // 假设0是成功状态码
                                  // 提交成功后，继续提交下一个表单
                                  setTimeout(function() {
                                      submitNextForm(index + 1);
                                  }, 3000);
                              } else {
                                  layer.close(loadIndex);
                                  layer.msg(res.msg || '保存失败');
                              }
                          },
                          error: function() {
                              layer.close(loadIndex);
                              layer.msg('提交失败，请重试');
                          }
                      });
                      
                      return false; // 阻止表单默认提交
                  });

                  // 触发表单提交，排除live_type_save按钮
                  $form.find('button[lay-filter="configpub-save"]')
                    .not('[name="live_type_save"]')
                    .click();
              }

              // 开始提交第一个表单
              submitNextForm(0);
          }
      });
    </script>
  </body>
</html>
